from hashlib import sha1


def hash_sha1(data):
    """生成字符串的hash值"""
    return sha1(data.encode("utf8")).hexdigest()